import Vue from 'vue'
import VueRouter from 'vue-router'
import HomeView from '../views/HomeView.vue'
let layout = () => import("@/pages/layout.vue")
let user = () => import("@/pages/user/index.vue")
let inn = () => import("@/pages/inn/index.vue")
let work = () => import("@/pages/work/index.vue")
let porject = () => import("@/pages/porject/index.vue")
let live = () => import("@/pages/live/index.vue")

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: "/layout/user",
    name: 'layout',
    component: layout,
    meta: {
      title: '布局组件',
    }
  },

  {
    path: '/layout',
    redirect: "/layout/user",
    name: 'layout',
    component: layout,
    meta: {
      title: '布局组件',
    },
    children: [

      {
        path: '/layout/user',
        name: 'user',
        component: user,
        meta: {
          title: '个人概述',
        },
      },

      {
        path: '/layout/inn',
        name: 'inn',
        component: inn,
        meta: {
          title: '技术客栈',
        },
      },

      {
        path: '/layout/work',
        name: 'work',
        component: work,
        meta: {
          title: '工作历程',
        },
      },

      {
        path: '/layout/porject',
        name: 'porject',
        component: porject,
        meta: {
          title: '项目案例',
        },
      },

      {
        path: '/layout/live',
        name: 'live',
        component: live,
        meta: {
          title: '项目案例',
        },
      },

    ]
  },
]

const router = new VueRouter({
  routes
})

export default router
